// 获取导航栏元素
const navList = document.querySelector('.nav-list');

// 监听鼠标悬停事件
navList.addEventListener('mouseover', function (event) {
  if (event.target.classList.contains('has-submenu')) {
    const submenu = event.target.querySelector('.submenu');
    submenu.style.display = 'block';
  }
});

navList.addEventListener('mouseout', function (event) {
  if (event.target.classList.contains('has-submenu')) {
    const submenu = event.target.querySelector('.submenu');
    submenu.style.display = 'none';
  }
});
